package com.shoulei.designpattern.abstractFactoryPattern;

/**
 * @ClassName:AbstractFactoryPatternDemo
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/3/31 17:18
 * @Verson:
 */
public class AbstractFactoryPatternDemo {
    public static void main(String[] args) {
        FactoryProducer factoryProducer = new FactoryProducer();
        ShapeFactory shapeFactory =(ShapeFactory) factoryProducer.getFactory("shape");
        shapeFactory.getShape("circle").draw();
        shapeFactory.getShape("rectangle").draw();

        ColorFactory colorFactory = (ColorFactory) factoryProducer.getFactory("color");
        colorFactory.getColor("red").fill();
        colorFactory.getColor("blue").fill();
    }
}
